<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        const foo = 'bar';
        const baz = {
            foo
        };
        baz // {foo: "bar"}

        // 等同于
        //const baz = {
        //  foo: foo
        //};
        console.log(baz);
    </script>
</body>

</html>